package org.dk.config;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号

    public static String app_id = "2021000117690024";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC8vY+S64focMkRzwKn6CNwsotMVRBJtPKtlMTFu+nZqGUQRIdak5eHq/prjuDNs8dBiHdwrOZhblejtfpQvWlyxx00pAmqbzWbxGTIh2TAljX7vMt7+MTiVIZVlqRi/AZyX6ArTpX2ymIPRw6P+qPKduqd3zJdnpCOcgjY3jgsM3+hJPFsHw1WRKf/H+oTqvMMwObBs243uYp9MQ78pITL0h3G2d9cyQ3dFXLbE+boS9xYuOav1ZxaDPD/AazVEtLudVp1s2ecQUtvZmixEzYpBmSAjh1/b1q+IMSnXwiM4WGuTpd60eof8lLsKjQbu9exegDejedXynccGCDTObs3AgMBAAECggEAL+MYrno7/WnAWlhfoCJx+4IRfciHXWwftpLsag8HgkYLflkkzoJsC+xCmU+jEg3vHF13kIsN2OKaMdtWK24jdw+2BUkpeqjEvUTTHV3c3lA+WiTIrCeuLI6tlsGl68duC07f4J0Lx5YJ0z6AH1/EdvY9CNk8eixlGP8t53haYDwv+F8WmoAPWI7qJlbqrSiHu8Eb18R7JpOl887dGBEkkTN0XBxrGgHUmTCQCrFQbQsr7z6Y/C4zBMzBw77KPxX1G10lOjhM18VNEbBIQVeJFoMYHEGCcyz/hchKOEHlDau8i2sMDs1+sGOJDLWyvh8CIzawROifxjWjpNhvcmNZYQKBgQD/LXAl5XrzsdS62NDPh7X5X+gS1cSX7kjRSha/wL2NRmmjLPpXTnsSfb9IKxXV90u/bC4foq2oRmh3logfJIV2mPtAN/G+DP3bffDcDhPtT3RHon0uyCh+14Q0kU0BpjgE9GiWHqjdcAp6b6bn8xfuTyGYF3EsyFBks5bHmkde3QKBgQC9WU06eUxQ7yn89Qa6aij/xHtZ6ZZ7d3YSsBp6+Wt7w9pSVSJ78sNB1prQDIfXM7NtYCffNe+9l18nbv568IidpymqiihGGilQLpcVBIw12dB0sdMfimQxRgGey8y53hbiT/txuGM476vXf02q0Hz8v6F0XI9isxyPgaE+c7cfIwKBgAK2v/+XLjSTSpjmH2plnhjV3Uj9/wZCoYGgURee/CUZf5wdqVfuXL64maUx2BybcbHKe78YYtJsVUYYUsBKCiVVwS5QqgCEcNq5vysH90xJ0QnF/6DUviGDN0O7297NnsDmvIoEL3WTcHkW4OaMnk+JhejxLuH0C27Wvh7HVET9AoGBAJP8uKxL40aaNdHbW3/UuuhzkwjJ1O/4hRLECl40lDnt77NLkKEZMlxBs0uJj521bbW9YkxFJnOiXB9A06oYVl4JKTp9sk5f4gwl7bTikgcAjri1xtEu43HTSi7nD8Hw/yev5VCTERGN2FubxoMLYbRUvYZpVTOJ03ehk/lwjR3LAoGAUU6gYBNTw/rTd5gwJ7lKeA+F4lXW50n3rZ6RCWec1RQKEboCHCVkVIsyx4jYOKqgTFFqjOXgxMUJ9oJbbJOSOwng6Mc9zbuajt3dAMxW/FmObzqUboCNttJBc10L9Gqrm6MgfSSngIkeg/EfXIq0/rhumvdHMuZJADGk3yF6Jag=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8fRBb8UNTKUiFRaMShOWTip7pvvMNIGWnCsTXQvS5RjrhY0vWTFFzzTtzejFLInzWRRnVYeu+tHLkL38LEbA1jYfVeC7pKahkjZnH2dCjkQHFwlfEr/MWPw24qsuWHlGdq/vbtrhUC2gH9wMG2zIXE5lUBXmz3a6P+VaiTE0MyU5f+laDg/qvCw82wD3oROypbtQiyT9cOfiDqmy08dRO77X8p4HMz/+h499aUA72VQGElhbazauqjoJQ0JgD0TJ8HA4YXQrr8Nncq5LRmtAKcpPeJCW/CXsssxZQ3IZg69EP5l2IcMwLkOwHUpbMz1iGddaY3OgCqy6NGNfnkIEBwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://5gi17gl.nat.ipyingshe.com/tradeController/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://5gi17gl.nat.ipyingshe.com/tradeController/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志打印位置
    public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
